import 'package:dk_flutter_base/dk_core.dart';
import 'package:dk_flutter_base/src/ui/widget/dk_app_bar.dart';
import 'package:flutter/material.dart';

class TestInherit extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TestPage();
  }
}

class TestPage extends BasePage<CommonPageBloc> {


  @override
  void onInitState(PageBloc pageBloc) {
    pageBloc.switchPage(TestWidget());
  }

  @override
  CommonPageBloc getPageBloc() {
    return CommonPageBloc();
  }
}

class CommonPageBloc extends PageBloc {}

class TestWidget extends StatefulWidget {
  @override
  State<TestWidget> createState() {
    return TestWidgetState();
  }
}

class TestWidgetState extends State<TestWidget> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: InkWell(
          onTap: () {
            CommonPageBloc bloc = BlocProvider.of<CommonPageBloc>(context);
            bloc.switchPage(Container(
              color: Colors.blue,
              child: Text("222222222222"),
            ));
          },
          child: Text("111111111"),
        ),
      ),
    );
  }
}
